package com.wxmit.module.system.web;

import cn.dev33.satoken.annotation.SaCheckPermission;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wxmit.base.domain.ApiResult;
import com.wxmit.framework.web.operatelog.Log;
import com.wxmit.framework.web.operatelog.enums.BusinessType;
import com.wxmit.base.validate.AddGroup;
import com.wxmit.base.validate.UpdateGroup;
import com.wxmit.module.system.domain.SysDictType;
import com.wxmit.module.system.service.ISysDictTypeService;
import com.wxmit.system.base.core.ShushanBaseController;
import com.wxmit.system.base.domain.PageDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 字典类型Controller
 * @author xiong
 * @date 2022-08-09
 */
@RestController
@RequestMapping("/system/type")
public class SysDictTypeController extends ShushanBaseController<ISysDictTypeService,SysDictType,Long>{

    public SysDictTypeController(ISysDictTypeService baseService){
        super(baseService,"system:type:");
    }

    @Override
    public ApiResult<IPage<SysDictType>> listPage(PageDTO<SysDictType> pageDTO) {
        IPage<SysDictType> result = baseService.listPage(pageDTO);
        return ApiResult.successWithData(result);
    }

    @PostMapping("listFull")
    public ApiResult<List<SysDictType>> listFull(@RequestBody SysDictType searchData) {
        List<SysDictType> result = baseService.getList(searchData);
        return ApiResult.successWithData(result);
    }


}